<div class="section" id="sitemaplist">
	<form action="" name="formlist" id="formlist" method="post">
	<div class="section-title">
		STOCK LIST
		<div class="button right">
			<input class="button" value="<?php echo $this->document->text['button_add']?>" type="button" onclick="linkto('<?php echo $insert?>')">
			<input class="button" type="button" name="delete_all" value="<?php echo $this->document->text['button_delete']?>" onclick="deleteList()"/>  
             <input type="button" onclick="window.close()" class="button" value="<?php echo $this->document->text['button_cancel']?>">
		</div>
		<div class="clearer">^&nbsp;</div>
	</div>
    
    <div class="section-content">
    	
            <div class="sitemap treeindex">
                <table class="data-table" cellpadding="0" cellspacing="0">
                <tbody>
                    <tr class="tr-head">
                        <th width="1%"><input class="inputchk" type="checkbox" onclick="$('input[name*=\'delete\']').attr('checked', this.checked);"></th>
                        <th width="10%"><?php echo $this->document->text['text_control']?></th>
						<th width="10%"><?php echo $this->document->text['text_stockid']?></th>
                        <th width="39%"><?php echo $this->document->text['text_stockname']?></th>
						<th width="40%"><?php echo $this->document->text['text_description']?>:</th>                                         
                    </tr>
        
        
        <?php
            foreach($stocks as $stock)
            {
        ?>
                    <tr>
                        <td class="check-column"><input class="inputchk" type="checkbox" name="delete[<?php echo $stock['stockid']?>]" value="<?php echo $stock['stockid']?>" ></td>
						<td class="link-control">
                            <a class="button" href="<?php echo $stock['link_edit']?>" title="<?php echo $stock['text_edit']?>"><?php echo $this->document->text['button_edit']?></a>
                        </td>
                        <td><?php echo $stock['stockid']?></td>
                        <td><?php echo $stock['stockname']?></td>
						<td><?php echo $stock['stockdescription']?></td>
                    </tr>
        <?php
            }
        ?>
                        
                                                    
                </tbody>
                </table>
            </div>
        
        
        </form>
        
    </div>
    
</div>
<script language="javascript">
function deleteList()
{
	$.post("?route=category/stock/delete", 
			$("#formlist").serialize(), 
			function(data)
			{
				if(data!="")
				{
					alert(data)
					linkto("?<?php echo $refres?>")
				}
			}
	);
}
</script>
